package com.poetry.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.poetry.domain.po.ChatMessage;
import com.poetry.exception.R;
import org.springframework.ai.chat.messages.Message;

import java.util.List;

public interface IChatMessageService extends IService<ChatMessage> {
    default void add(String conversationId, Message message) {this.add(conversationId, List.of(message));}

    void add(String conversationId, List<Message> messages);

    List<Message> get(String conversationId, int lastN);

    void clear(String conversationId);

    R<List<ChatMessage>> getChatHistory(String conversationId);
}
